#define _XOPEN_SOURCE
#include <unistd.h>
#include <stdio.h>

int main()
{
    const char *password = "my_password";
    const char *salt = "$6$saltstring"; // 使用 SHA-512 算法的 salt

    char *encrypted = crypt(password, salt);
    if (encrypted == NULL)
    {
        perror("crypt");
        return 1;
    }

    printf("加密后的密码是: %s\n", encrypted);
    return 0;
}